<?php

use think\facade\Route;

//首页
Route::get('/', 'index/index')->middleware('verify');

//上传
Route::group('uploads', function () {
    Route::rule('/uploadImage', 'uploads/uploadImage');
})->ext('html');

Route::group('index', function () {
    Route::get('/index', 'index/index');
    Route::get('/welcome', 'index/welcome');
    Route::get('/clear_cache', 'index/clear_cache');
})->middleware('verify')->ext('html');

//登录
Route::group('login', function () {
    Route::get('/index', 'login/index');
    Route::post('/check', 'login/check');
    Route::post('/logout', 'login/logout');
})->ext('html');

//会员管理
Route::group('user', function () {
    Route::get('/ordinary', 'user/ordinary');
    Route::get('/formal', 'user/formal');
    Route::get('/add', 'user/add');
    Route::get('/edit', 'user/edit');
    Route::post('/reset', 'user/reset');
    Route::post('/save', 'user/save');
    Route::post('/login', 'user/login');
    Route::rule('/recharge', 'user/recharge','POST|GET');
    Route::get('/export', 'user/export');
    Route::get('/getList', 'user/getList');
    Route::get('/login', 'user/login');
    Route::post('/proRuleAdd', 'user/proRuleAdd');
    Route::get('/prorule', 'user/prorule');
    Route::post('/update', 'user/update');
    Route::post('/delete', 'user/delete');
})->middleware('verify')->ext('html');

//新闻公告
Route::group('news', function () {
    Route::get('/index', 'news/index');
    Route::get('/getList', 'news/getList');
    Route::get('/add', 'news/add');
    Route::get('/edit', 'news/edit');
    Route::get('/export', 'news/export');
    Route::post('/save', 'news/save');
    Route::post('/update', 'news/update');
    Route::post('/delete', 'news/delete');
})->middleware('verify');


//区域管理
Route::group('district', function () {
    Route::get('/index', 'district/index');
    Route::get('/getList', 'district/getList');
    Route::get('/add', 'district/add');
    Route::get('/edit', 'district/edit');
    Route::get('/export', 'district/export');
    Route::post('/save', 'district/save');
    Route::post('/update', 'district/update');
    Route::post('/delete', 'district/delete');
})->middleware('verify');

//区域场所管理
Route::group('districtPro', function () {
    Route::get('/index', 'districtPro/index');
    Route::get('/getList', 'districtPro/getList');
    Route::get('/add', 'districtPro/add');
    Route::get('/edit', 'districtPro/edit');
    Route::get('/export', 'districtPro/export');
    Route::post('/save', 'districtPro/save');
    Route::post('/update', 'districtPro/update');
    Route::post('/delete', 'districtPro/delete');
})->middleware('verify');


//项目管理
Route::group('pro', function () {
    Route::get('/index', 'pro/index');
    Route::get('/getList', 'pro/getList');
    Route::get('/placelist', 'pro/placelist');
    Route::get('/statistics', 'pro/statistics');
    Route::get('/dangerStatistics', 'pro/dangerStatistics');
    Route::get('/placeStatistics', 'pro/placeStatistics');
    
    Route::get('/exportExcel', 'pro/exportExcel');
    Route::post('/pdfshowpost', 'pro/pdfshowpost');
    Route::rule('/exportImage', 'pro/exportImage');
    
    Route::get('/add', 'pro/add');
    Route::get('/edit', 'pro/edit');
    Route::get('/export', 'pro/export');
    Route::post('/save', 'pro/save');
    Route::post('/update', 'pro/update');
    Route::post('/delete', 'pro/delete');
    Route::post('/prodel', 'pro/prodel');
    Route::post('/placeadd', 'pro/placeadd');
    Route::rule('/exportExcelYh', 'pro/exportExcelYh');
})->middleware('verify');

//项目分类管理
Route::group('proCate', function () {
    Route::get('/index', 'proCate/index');
    Route::get('/getList', 'proCate/getList');
    Route::get('/getCate', 'proCate/getCate');
    Route::get('/add', 'proCate/add');
    Route::get('/edit', 'proCate/edit');
    Route::get('/export', 'proCate/export');
    Route::post('/save', 'proCate/save');
    Route::post('/update', 'proCate/update');
    Route::post('/delete', 'proCate/delete');
})->middleware('verify');


//项目题库管理
Route::group('proTopic', function () {
    Route::get('/index', 'proTopic/index');
    Route::get('/getList', 'proTopic/getList');
    Route::get('/add', 'proTopic/add');
    Route::get('/edit', 'proTopic/edit');
    Route::get('/export', 'proTopic/export');
    Route::post('/save', 'proTopic/save');
    Route::post('/update', 'proTopic/update');
    Route::post('/delete', 'proTopic/delete');
    Route::post('/companyAlldel', 'proTopic/companyAlldel');
    Route::post('/importcompanyexcel', 'proTopic/importcompanyexcel');
})->middleware('verify');
//场所性质管理
Route::group('proPlace', function () {
    Route::get('/index', 'proPlace/index');
    Route::get('/getList', 'proPlace/getList');
    Route::get('/add', 'proPlace/add');
    Route::get('/edit', 'proPlace/edit');
    Route::get('/export', 'proPlace/export');
    Route::post('/save', 'proPlace/save');
    Route::post('/update', 'proPlace/update');
    Route::post('/delete', 'proPlace/delete');
})->middleware('verify');

//公司管理
Route::group('company', function () {
    Route::get('/index', 'company/index');
    Route::get('/showmap', 'company/showmap');
    Route::get('/getList', 'company/getList');
    Route::get('/add', 'company/add');
    Route::get('/edit', 'company/edit');
    Route::get('/export', 'company/export');
    Route::post('/save', 'company/save');
    Route::post('/update', 'company/update');
    Route::post('/delete', 'company/delete');
    Route::post('/companydel', 'company/companydel');
    Route::post('/companyAlldel', 'company/companyAlldel');
    
    Route::post('/importcompanyexcel', 'company/importcompanyexcel');
    Route::get('/exportAddExcel', 'company/exportAddExcel');
    
})->middleware('verify');

//检查列表
Route::group('checkList', function () {
    Route::get('/index', 'checkList/index');
    Route::get('/showmap', 'checkList/showmap');
    Route::get('/getList', 'checkList/getList');
    Route::get('/add', 'checkList/add');
    Route::get('/edit', 'checkList/edit');
    Route::get('/export', 'checkList/export');
    Route::get('/exportExcel', 'checkList/exportExcel');
    
    Route::post('/importExcel', 'checkList/importExcel');
    Route::post('/save', 'checkList/save');
    Route::post('/update', 'checkList/update');
    Route::post('/delete', 'checkList/delete');
})->middleware('verify');

//轮播管理
Route::group('carousel', function () {
    Route::get('/index', 'carousel/index');
    Route::get('/getList', 'carousel/getList');
    Route::get('/add', 'carousel/add');
    Route::get('/edit', 'carousel/edit');
    Route::post('/save', 'carousel/save');
    Route::post('/update', 'carousel/update');
    Route::post('/delete', 'carousel/delete');
})->middleware('verify');

//消息管理
Route::group('notice', function () {
    Route::get('/group', 'notice/group');
    Route::get('/getData', 'notice/getData');
    Route::get('/show_order', 'notice/show_order');
    Route::get('/show_user', 'notice/show_user');
    Route::get('/show_message', 'notice/show_message');
    Route::get('/all_read', 'notice/all_read');
    Route::get('/noticeCount', 'notice/noticeCount');
})->middleware('verify');
//菜单管理
Route::group('menu', function () {
    Route::get('/index', 'menu/index');
    Route::get('/getList', 'menu/getList');
    Route::get('/add', 'menu/add');
    Route::get('/edit', 'menu/edit');
    Route::post('/save1', 'menu/save1');
    Route::rule('/update', 'menu/update');
    Route::post('/delete', 'menu/delete');
})->middleware('verify');


//网站配置
Route::group('config', function () {
    Route::get('/index', 'config/index');
    Route::get('/getList', 'config/getList');
    Route::get('/add', 'config/add');
    Route::get('/edit', 'config/edit');
    Route::post('/save', 'config/save');
    Route::post('/update', 'config/update');
    Route::post('/delete', 'config/delete');
    Route::get('/create', 'config/create');
    Route::post('/saveGroup', 'config/saveGroup');
})->middleware('verify');

//角色管理
Route::group('role', function () {
    Route::get('/index', 'role/index');
    Route::get('/getList', 'role/getList');
    Route::get('/add', 'role/add');
    Route::get('/edit', 'role/edit');
    Route::post('/save', 'role/save');
    Route::post('/update', 'role/update');
    Route::post('/delete', 'role/delete');
    Route::rule('/give', 'role/give');
})->middleware('verify');

//用户列表
Route::group('admin', function () {
    Route::get('/index', 'admin/index');
    Route::get('/getList', 'admin/getList');
    Route::get('/add', 'admin/add');
    Route::get('/edit', 'admin/edit');
    Route::post('/save', 'admin/save');
    Route::post('/update', 'admin/update');
    Route::post('/delete', 'admin/delete');
    Route::rule('/password', 'admin/password');
})->middleware('verify');


//数据管理
Route::group('backup', function () {
    Route::get('/index', 'backup/index');
    Route::get('/add', 'backup/add');
    Route::get('/import', 'backup/import');
    Route::get('/clear', 'backup/clear');
    Route::get('/backup', 'backup/delete');
})->middleware('verify');

//操作日志
Route::group('logs', function () {
    Route::get('/index', 'logs/index');
    Route::get('/getList', 'logs/getList');
    Route::get('/queryIp', 'logs/queryIp');
})->middleware('verify');